#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_timedelta.py
# author:Jackiex
# datetime:2023/4/24 11:14
# software: PyCharm

"""
this is function  description 
"""

from datetime import timedelta
from datetime import datetime

# time1 = datetime(2016, 10, 20)
# time2 = datetime(2015, 11, 2)
# """计算天数差值"""
# print((time1-time2).days)
#
# """计算两个日期之间相隔的秒数"""
# print((time1-time2).total_seconds())



# # 创建一个表示10天的timedelta对象
# delta = datetime.timedelta(days=10)
#
# # 创建一个表示2小时的timedelta对象
# delta = datetime.timedelta(hours=2)


# import datetime
#
# # 计算两个日期之间的天数差异
# date1 = datetime.date(2023, 4, 20)
# date2 = datetime.date(2023, 4, 15)
# delta = date1 - date2
# print(delta.days)  # 输出5
#
# # 计算两个时间之间的秒数差异
# time1 = datetime.time(12, 0, 0)
# time2 = datetime.time(13, 30, 0)
# delta = datetime.timedelta(hours=time2.hour - time1.hour, minutes=time2.minute - time1.minute, seconds=time2.second - time1.second)
# print(delta.seconds)  # 输出5400

import datetime

# 将当前日期加上一个月
today = datetime.date.today()
one_month_later = today + datetime.timedelta(days=30)
print(one_month_later)

# 将当前时间加上10分钟
now = datetime.datetime.now()
ten_minutes_later = now + datetime.timedelta(minutes=10)
